﻿<Window x:Class="Nox.Amuse.View.UpdateStatusDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Amuse Updates"
        SizeToContent="WidthAndHeight"
        ShowInTaskbar="False"
        ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner"
        RenderOptions.BitmapScalingMode="HighQuality"
        Icon="/Amuse;component/Amuse.ico">
    <Grid Margin="11">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Border Grid.ColumnSpan="3"
                Margin="-11,-11,-11,0">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0"
                                     Opacity="0.5">
                    <GradientStop Offset="0"
                                  Color="#FF0E74FF" />
                    <GradientStop Color="White"
                                  Offset="0.4" />
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <Image Height="48"
               Width="48"
               Margin="0,0,7,0"
               Source="/Amuse;component/Images/update_circle_256.png" />
        <TextBlock Grid.Column="1"
                   Grid.ColumnSpan="2"
                   HorizontalAlignment="Left"
                   Text="{Binding StatusMainInstruction, FallbackValue='Check for updates'}"
                   VerticalAlignment="Center"
                   Foreground="DodgerBlue"
                   TextWrapping="Wrap"
                   Width="355"
                   FontSize="18" />
        <TextBlock Grid.Row="1"
                   Grid.Column="1"
                   Grid.ColumnSpan="2"
                   TextWrapping="Wrap"
                   Margin="0,0,0,11"
                   Width="355"
                   Text="{Binding StatusSecondaryText, FallbackValue='Amuse will automatically check for updates periodically.'}" />

        <ProgressBar Grid.Column="1"
                     Grid.Row="2"
                     Height="15"
                     Width="355"
                     Margin="0,0,0,7"
                     IsIndeterminate="{Binding ProgressState, FallbackValue=True}"
                     Visibility="{Binding ProgressVisibility, FallbackValue=Collapsed}"
                     Value="{Binding ProgressValue, Mode=OneWay, FallbackValue=0}"
                     Foreground="{Binding ProgressColor, FallbackValue={StaticResource ProgressGreenBrush}}" />
        <TextBlock Grid.Column="1"
                   Grid.Row="3"
                   Margin="0,0,0,11"
                   Width="355"
                   TextWrapping="Wrap"
                   Visibility="{Binding DownloadTextVisibility, FallbackValue=Collapsed}"
                   Text="{Binding DownloadText, FallbackValue='Preparing to download...'}" />
        <StackPanel Grid.ColumnSpan="2"
                    Grid.Row="4"
                    Orientation="Horizontal">
            <TextBlock Text="Most recent check for updates:"
                       HorizontalAlignment="Right"
                       Margin="0,0,5,11" />
            <TextBlock Text="{Binding MostRecentCheckTimeDate, FallbackValue='13:00 - 5 June 1985'}"
                       HorizontalAlignment="Left"
                       Margin="0,0,0,11" />
        </StackPanel>
        <Border Grid.Row="5"
                Grid.ColumnSpan="3"
                Margin="-11,0,-11,-11">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0"
                                     Opacity="0.5">
                    <GradientStop Color="White"
                                  Offset="0.2" />
                    <GradientStop Color="{StaticResource {x:Static SystemColors.ControlDarkColorKey}}"
                                  Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <TextBlock Grid.ColumnSpan="2"
                   Grid.Row="5"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Visibility="{Binding ExdownloadVisibility, FallbackValue=Collapsed}">
                <Hyperlink Command="{Binding ExDownloadCommand}">
                    <Run Text="Download Update in my Browser" />
                </Hyperlink>
        </TextBlock>
        <StackPanel Orientation="Horizontal"
                    Grid.Column="2"
                    Grid.Row="5"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Bottom"
                    Grid.RowSpan="2">
            <Button Content="{Binding StatusCommitText, FallbackValue='Check for _updates'}"
                    Padding="7,0"
                    IsDefault="True"
                    Command="{Binding StatusCommitCommand}"
                    Margin="0,0,7,0" />
            <Button Content="_Close"
                    Padding="7,0"
                    Click="CloseButton_Click" />
        </StackPanel>
    </Grid>
</Window>
